home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Libraries
/
TransSkel
/
Convenience
/
SkelPause.c
< prev
Wrap
Text File
|
1994-02-20
|
711b
|
31 lines
/*
* SkelPause ()
*
* Pause process execution for the given length of time, measured in ticks
* (60ths of a second). If running in a multitasking environment, gives
* time to other processes, using the wait value that's appropriate for
* whether the application's in the foreground or background.
*/
# include "TransSkel.h"
pascal void
SkelPause (long ticks)
{
long current;
long waitTime;
EventRecord event;
if (SkelQuery (skelQInForeground))
SkelGetWaitTimes (&waitTime, (long *) nil);
else
SkelGetWaitTimes ((long *) nil, &waitTime);
current = TickCount ();
while (TickCount () < current + ticks)
{
if (SkelQuery (skelQHasWNE))
(void) WaitNextEvent (0, &event, waitTime, nil);
}
}